<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>登录</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="../static/css/amazeui.css" />
<link href="../static/css/dlstyle.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery-2.0.0.min.js" type="text/javascript"></script>
<script src="../static/js/myinit.js" type="text/javascript"></script>
<script src="../static/js/qrcode.js" type="text/javascript"></script>
</head>

<body>
	<div class="login-boxtitle">
		<a href="home.html"><img alt="logo"
			src="../static/img/logobig.png" /></a>
	</div>
	<div class="login-banner">
		<div class="login-main">
			<div class="login-banner-bg">
				<span></span><img src="../static/img/big.jpg" />
			</div>
			<div class="login-box">
				<h3 class="title">登录商城</h3>
				<div class="clear"></div>
				<div class="login-form" id="erweima">
				</div>



			</div>
		</div>
	</div>
	<div class="footer ">
		<div class="footer-hd">
			<p>
				<img src="../static/img/duo.png" style="width: 25px" />品类齐全<b>|</b><img
					src="../static/img/kuai.png" style="width: 25px" />多仓直发<b>|</b><img
					src="../static/img/hao.png" style="width: 25px" />正品行货<b>|</b><img
					src="../static/img/sheng.png" style="width: 25px" />天天低价
			</p>
		</div>
		<div class="footer-bd "></div>
	</div>
	<script type="text/javascript">
		var time=new Date().getTime().toString();
		var cd = time+""+ parseInt(Math.random()*time);
		var url_erweima="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1ef1259eec8b148d&redirect_uri=http%3a%2f%2fwww.tiantianhw.cn%2fmshop%2ferweimalogin.html%3fERWEIMACODE%3d"+cd+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
		$('#erweima').empty();
		var qrcode = new QRCode('erweima', {
			text: url_erweima,
			width: 300,
			height: 300,
			colorDark : '#000000',
			colorLight : '#ffffff',
			correctLevel : QRCode.CorrectLevel.L
		});
		$('#erweima').find('img').css({'width':'100%','height':'auto'});
		
		
		var repeattime=setInterval(function(){
			getcode();
			 
		},1000);
		
		function getcode(){
			var url = '/weixin/getAcctSts/?loginparm='+cd;
			$.getJSON(url,function(rs){
				if(rs.logsts!='N'){
					getOpenid(rs.logsts);
					clearInterval(repeattime);
					 
				}
				
			});
		}
		
		function getOpenid(code){
		$.post('/weixin/getopenid/',{"code":code},function(aa){
			var openid=aa.openid;
			
			toastwithaction('登录成功',function(){
				document.location.href="index_pc.html";
			});
			
		}, "json");

	 
	}
		
	
	</script>
</body>
</html>